<!DOCTYPE html>
<html lang="zh_CN" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>俱乐部类型</title>
    <link rel="stylesheet" th:href="@{/static/layui/css/layui.css}" media="all">
    <link rel="stylesheet" th:href="@{/static/admin/style.css}" media="all">
</head>
<body>
<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-card-body" style="padding: 15px;">
            <form class="layui-form layui-form-pane" action="">
                <input name="id" th:value="${obj?.id}" class="layui-input layui-hide"/>
                <div class="layui-form-item">
                    <label class="layui-form-label">俱乐部类型名称</label>
                    <div class="layui-input-block">
                        <input type="text" name="typeName" th:value="${obj?.typeName}"
                               lay-verify="required|username"
                               placeholder="请输入俱乐部类型名称" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">创建时间</label>
                    <div class="layui-input-block">
                        <input type="text" readonly name="createTime" id="createTime"
                               th:value="${obj?.strCreationTime}" lay-verify="required|datetime"
                               placeholder="请输入创建时间"
                               autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item layui-hide">
                    <input type="button" lay-submit lay-filter="LAY-front-submit" id="LAY-front-submit" value="确认">
                </div>
            </form>
        </div>
    </div>
</div>
<script th:src="@{/static/layui/layui.js}"></script>
<script>
    layui.use(['form', 'laydate'], function () {
        var $ = layui.$;
        var laydate = layui.laydate;
        var form = layui.form;

        //支持日期控件
        laydate.render({
            elem: '#createTime',
            type: 'datetime',
            // value: new Date(),
            max: new Date().toLocaleString(),
            trigger: 'click'
        });

        form.verify({
            username: function (value, item) { //value：表单的值、item：表单的DOM对象
                if (!new RegExp("^[a-zA-Z0-9_\u4e00-\u9fa5\\s·]+$").test(value)) {
                    return '名称不能有特殊字符';
                }
                if (/(^\_)|(\__)|(\_+$)/.test(value)) {
                    return '名称首尾不能出现下划线\'_\'';
                }
                if (/^[0-9]\d*$/.test(value)) {
                    return '名称不能全为数字';
                }
            }
            , positiveInteger: [
                /^[+]{0,1}(\d+)$/,
                '活动次数和会员数量必须为正整数！'
            ]
        });
    });
</script>
</body>
</html>
















